/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.cesupa.cabcc.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 *
 * @author yuri
 */
@Entity
@NamedQueries({
    @NamedQuery(name="Cargo.findById", query="SELECT c FROM Cargo c WHERE c.id = :id"),
    @NamedQuery(name="Cargo.findByNome", query="SELECT c FROM Cargo c WHERE c.nome = :nome"),
    @NamedQuery(name="Cargo.findLikeNome", query="SELECT c FROM Cargo c WHERE c.nome LIKE :nome"),
    @NamedQuery(name="Cargo.findLikeFuncao", query="SELECT c FROM Cargo c WHERE c.funcao LIKE :funcao"),
    @NamedQuery(name="Cargo.findAll", query="SELECT c FROM Cargo c")
})
public class Cargo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    private String nome;
    @Lob
    private String funcao;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cargo)) {
            return false;
        }
        Cargo other = (Cargo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.cesupa.cabcc.entity.Cargo[id=" + id + "]";
    }

    /**
     * @return the nome
     */
    public String getNome() {
        return nome;
    }

    /**
     * @param nome the nome to set
     */
    public void setNome(String nome) {
        this.nome = nome;
    }

    /**
     * @return the funcao
     */
    public String getFuncao() {
        return funcao;
    }

    /**
     * @param funcao the funcao to set
     */
    public void setFuncao(String funcao) {
        this.funcao = funcao;
    }

}
